﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace BusinessObjects {
  /// <summary>
  /// User object
  /// </summary>
  public class User : Person {

    private string emergencyPhone, startTime, stopTime, loginName, password, salt;
    private bool autoLogin;
    private byte level;
    private DateTime lastActivity;

    #region - Properties -

    /// <summary>
    /// Gets or sets the salt.
    /// </summary>
    /// <value>
    /// The salt.
    /// </value>
    public string Salt {
      get { return salt; }
      set { salt = value; }
    }

    /// <summary>
    /// Gets or sets the password.
    /// </summary>
    /// <value>
    /// The password.
    /// </value>
    public string Password {
      get { return password; }
      set { password = value; }
    }

    /// <summary>
    /// Gets the name of the lowered login.
    /// </summary>
    /// <value>
    /// The name of the lowered login.
    /// </value>
    public string LoweredLoginName {
      get { return string.IsNullOrEmpty( LoginName ) ? string.Empty : LoginName.ToLower( CultureInfo.CurrentCulture ); }
    }

    /// <summary>
    /// Gets or sets the name of the login.
    /// </summary>
    /// <value>
    /// The name of the login.
    /// </value>
    public string LoginName {
      get { return loginName; }
      set { SetField( ref loginName, value, "LoginName" ); }
    }

    /// <summary>
    /// Gets or sets a value indicating whether [auto login].
    /// </summary>
    /// <value>
    ///   <c>true</c> if [auto login]; otherwise, <c>false</c>.
    /// </value>
    public bool AutoLogin {
      get { return autoLogin; }
      set { SetField( ref autoLogin, value, "AutoLogin" ); }
    }

    /// <summary>
    /// Gets or sets the level.
    /// </summary>
    /// <value>
    /// The level.
    /// </value>
    public byte Level {
      get { return level; }
      set { SetField( ref level, value, "Level" ); }
    }

    /// <summary>
    /// Gets or sets the last activity.
    /// </summary>
    /// <value>
    /// The last activity.
    /// </value>
    public DateTime LastActivity {
      get { return lastActivity; }
      set { SetField( ref lastActivity, value, "LastActivity" ); }
    }

    /// <summary>
    /// Gets or sets the stop time.
    /// </summary>
    /// <value>
    /// The stop time.
    /// </value>
    public string StopTime {
      get { return stopTime; }
      set { SetField( ref stopTime, value, "StopTime" ); }
    }

    /// <summary>
    /// Gets or sets the start time.
    /// </summary>
    /// <value>
    /// The start time.
    /// </value>
    public string StartTime {
      get { return startTime; }
      set { SetField( ref startTime, value, "StartTime" ); }
    }

    /// <summary>
    /// Gets or sets the emergency phone.
    /// </summary>
    /// <value>
    /// The emergency phone.
    /// </value>
    public string EmergencyPhone {
      get { return emergencyPhone; }
      set { SetField( ref emergencyPhone, value, "EmergencyPhone" ); }
    }

    #endregion

    #region - Constructor -

    /// <summary>
    /// Initializes a new instance of the <see cref="User"/> class.
    /// </summary>
    public User( ) {
      this.Address = new Address( );
    }

    #endregion


  }
}
